import { groupBy } from "underscore";
import Studycodemodel from "../mysql_interface/studycodemodel";

export default function subtask(info: Studycodemodel.Iuserquestion['info']) {
    if (Array.isArray(info)) {
        const d = groupBy(info, (e) => {
            return e.groupA ? e.groupA : 0;
        });
        const k = Object.keys(d).sort((a, b) => Number(a) - Number(b));
        const data = [];
        for (const v of k) {
            data.push(d[v]);
        }
        return data;
    }
    return [[]];
}